﻿{extend name="public:base" /}

{block name="css"}
<link rel="stylesheet" type="text/css" href="/static/layui/css/layui.css"/>
<link rel="stylesheet" type="text/css" href="__ADMIN__/css/style.css">{/block}

{block name="content"}

<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-content">
                    <form method="post">
                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">企业名称</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" name="company_name" value="{$info.company_name}" readonly>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">企业证件类型</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" name="company_id_type" value="{$info.company_id_type}" readonly>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">企业证件号</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" name="company_id_num" value="{$info.company_id_num}" readonly>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">企业营业执照</label>
                                <div class="col-sm-3">
                                    <img class="upload-file" src="{$info.company_img}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">法人姓名</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" name="user_name" value="{$info.user_name}" readonly>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">法人证件类型</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" name="user_id_type" value="{$info.user_id_type}" readonly>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">法人证件号</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" name="user_id_num" value="{$info.user_id_num}" readonly>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">法人手机号</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" name="user_mobile" value="{$info.user_mobile}" readonly>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        {if $info.status == 0}
                        <div class="box-item">
                            <div class="form-group row layui-form">
                                <label class="col-lg-1 col-form-label">状态</label>
                                <div class="col-lg-3">
                                    <input type="radio" name="status" value="0" lay-filter="status" title="待审核" {$info.status== 0 ? 'checked' : ''}>
                                    <input type="radio" name="status" value="1" lay-filter="status" title="审核通过" {$info.status== 1 ? 'checked' : ''}>
                                    <input type="radio" name="status" value="2" lay-filter="status" title="审核驳回" {$info.status== 2 ? 'checked' : ''}>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item refuse_reason" style="display: none">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">驳回原因</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" name="refuse_reason" value="{$info.refuse_reason}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>
                        {/if}

                        <input type="hidden" name="id" value="{$info.id}">

                        <div class="form-group row">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button type="button" class="btn btn-w-m btn-default back-page">返回</button>
                                {if $info.status == 0}<button type="button" class="btn btn-w-m btn-primary ajax-post">提交</button>{/if}
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

{/block}

{block name='js'}
<script src="__STATIC__/layui/layui.js"></script>
<script>
    var status = "{$info.status}";

    if (status == 2) {
        $('.refuse_reason').show();
    } else {
        $('.refuse_reason').hide();
    }

    layui.use(['form'], function () {
        var form = layui.form;

        // 监听 radio 选中事件
        form.on('radio(status)', function (data) {
            var status = data.value;

            if (status == 2) {
                $('.refuse_reason').show();
            } else {
                $('.refuse_reason').hide();
            }
        });

        form.render();
    })
</script>{/block}
